#include "config.h"
#include "methodDef.h"
#include "methodCollection_t.h"
#include "cmdBuffer_t.h"
#include "cbgl.h"
#include <assert.h>

extern methodCollection_t* g_gl;
extern int g_state;
extern cmdBuffer_t* g_cB;


CBGL_API void glAccum (GLenum op, GLfloat value){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glAccum");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glAccum(op, value);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glAccum, p, sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glAccum");*/
}


CBGL_API void glAlphaFunc (GLenum func, GLclampf ref){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glAlphaFunc");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glAlphaFunc(func, ref);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLclampf));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLclampf));
		cmdBuffer_addCmd(g_cB, g_gl->glAlphaFunc, p, sizeof(GLenum)+sizeof(GLclampf));
	}
	/*cbgl_profile_end("glAlphaFunc");*/
}


CBGL_API GLboolean glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences){
	/*cbgl_profile_begin("glAreTexturesResident");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glAreTexturesResident(n, textures, residences);
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glAreTexturesResident(n, textures, residences);
	}
}


CBGL_API void glArrayElement (GLint i){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glArrayElement");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glArrayElement(i);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glArrayElement, p, sizeof(GLint));
	}
	/*cbgl_profile_end("glArrayElement");*/
}


CBGL_API void glBegin (GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glBegin");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glBegin(mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glBegin, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glBegin");*/
}


CBGL_API void glBindTexture (GLenum target, GLuint texture){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glBindTexture");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glBindTexture(target, texture);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glBindTexture, p, sizeof(GLenum)+sizeof(GLuint));
	}
	/*cbgl_profile_end("glBindTexture");*/
}


CBGL_API void glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glBitmap");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLubyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLubyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glBitmap, p, sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLubyte*));
	}
	/*cbgl_profile_end("glBitmap");*/
}


CBGL_API void glBlendFunc (GLenum sfactor, GLenum dfactor){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glBlendFunc");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glBlendFunc(sfactor, dfactor);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glBlendFunc, p, sizeof(GLenum)+sizeof(GLenum));
	}
	/*cbgl_profile_end("glBlendFunc");*/
}


CBGL_API void glCallList (GLuint list){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCallList");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCallList(list);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glCallList, p, sizeof(GLuint));
	}
	/*cbgl_profile_end("glCallList");*/
}


CBGL_API void glCallLists (GLsizei n, GLenum type, const GLvoid *lists){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCallLists");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCallLists(n, type, lists);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glCallLists, p, sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glCallLists");*/
}


CBGL_API void glClear (GLbitfield mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glClear");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glClear(mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbitfield));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbitfield));
		cmdBuffer_addCmd(g_cB, g_gl->glClear, p, sizeof(GLbitfield));
	}
	/*cbgl_profile_end("glClear");*/
}


CBGL_API void glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glClearAccum");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glClearAccum(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glClearAccum, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glClearAccum");*/
}


CBGL_API void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glClearColor");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glClearColor(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLclampf)+sizeof(GLclampf)+sizeof(GLclampf)+sizeof(GLclampf));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLclampf)+sizeof(GLclampf)+sizeof(GLclampf)+sizeof(GLclampf));
		cmdBuffer_addCmd(g_cB, g_gl->glClearColor, p, sizeof(GLclampf)+sizeof(GLclampf)+sizeof(GLclampf)+sizeof(GLclampf));
	}
	/*cbgl_profile_end("glClearColor");*/
}


CBGL_API void glClearDepth (GLclampd depth){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glClearDepth");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glClearDepth(depth);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLclampd));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLclampd));
		cmdBuffer_addCmd(g_cB, g_gl->glClearDepth, p, sizeof(GLclampd));
	}
	/*cbgl_profile_end("glClearDepth");*/
}


CBGL_API void glClearIndex (GLfloat c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glClearIndex");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glClearIndex(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glClearIndex, p, sizeof(GLfloat));
	}
	/*cbgl_profile_end("glClearIndex");*/
}


CBGL_API void glClearStencil (GLint s){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glClearStencil");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glClearStencil(s);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glClearStencil, p, sizeof(GLint));
	}
	/*cbgl_profile_end("glClearStencil");*/
}


CBGL_API void glClipPlane (GLenum plane, const GLdouble *equation){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glClipPlane");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glClipPlane(plane, equation);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glClipPlane, p, sizeof(GLenum)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glClipPlane");*/
}


CBGL_API void glColor3b (GLbyte red, GLbyte green, GLbyte blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3b");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3b(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3b, p, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
	}
	/*cbgl_profile_end("glColor3b");*/
}


CBGL_API void glColor3bv (const GLbyte *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3bv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3bv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3bv, p, sizeof(GLbyte*));
	}
	/*cbgl_profile_end("glColor3bv");*/
}


CBGL_API void glColor3d (GLdouble red, GLdouble green, GLdouble blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3d(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glColor3d");*/
}


CBGL_API void glColor3dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glColor3dv");*/
}


CBGL_API void glColor3f (GLfloat red, GLfloat green, GLfloat blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3f(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glColor3f");*/
}


CBGL_API void glColor3fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glColor3fv");*/
}


CBGL_API void glColor3i (GLint red, GLint green, GLint blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3i(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glColor3i");*/
}


CBGL_API void glColor3iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glColor3iv");*/
}


CBGL_API void glColor3s (GLshort red, GLshort green, GLshort blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3s(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glColor3s");*/
}


CBGL_API void glColor3sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glColor3sv");*/
}


CBGL_API void glColor3ub (GLubyte red, GLubyte green, GLubyte blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3ub");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3ub(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3ub, p, sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte));
	}
	/*cbgl_profile_end("glColor3ub");*/
}


CBGL_API void glColor3ubv (const GLubyte *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3ubv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3ubv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3ubv, p, sizeof(GLubyte*));
	}
	/*cbgl_profile_end("glColor3ubv");*/
}


CBGL_API void glColor3ui (GLuint red, GLuint green, GLuint blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3ui");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3ui(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3ui, p, sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint));
	}
	/*cbgl_profile_end("glColor3ui");*/
}


CBGL_API void glColor3uiv (const GLuint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3uiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3uiv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3uiv, p, sizeof(GLuint*));
	}
	/*cbgl_profile_end("glColor3uiv");*/
}


CBGL_API void glColor3us (GLushort red, GLushort green, GLushort blue){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3us");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3us(red, green, blue);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3us, p, sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort));
	}
	/*cbgl_profile_end("glColor3us");*/
}


CBGL_API void glColor3usv (const GLushort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor3usv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor3usv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLushort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLushort*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor3usv, p, sizeof(GLushort*));
	}
	/*cbgl_profile_end("glColor3usv");*/
}


CBGL_API void glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4b");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4b(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4b, p, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
	}
	/*cbgl_profile_end("glColor4b");*/
}


CBGL_API void glColor4bv (const GLbyte *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4bv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4bv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4bv, p, sizeof(GLbyte*));
	}
	/*cbgl_profile_end("glColor4bv");*/
}


CBGL_API void glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4d(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glColor4d");*/
}


CBGL_API void glColor4dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glColor4dv");*/
}


CBGL_API void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4f(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glColor4f");*/
}


CBGL_API void glColor4fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glColor4fv");*/
}


CBGL_API void glColor4i (GLint red, GLint green, GLint blue, GLint alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4i(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glColor4i");*/
}


CBGL_API void glColor4iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glColor4iv");*/
}


CBGL_API void glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4s(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glColor4s");*/
}


CBGL_API void glColor4sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glColor4sv");*/
}


CBGL_API void glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4ub");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4ub(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4ub, p, sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte)+sizeof(GLubyte));
	}
	/*cbgl_profile_end("glColor4ub");*/
}


CBGL_API void glColor4ubv (const GLubyte *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4ubv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4ubv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4ubv, p, sizeof(GLubyte*));
	}
	/*cbgl_profile_end("glColor4ubv");*/
}


CBGL_API void glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4ui");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4ui(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4ui, p, sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint)+sizeof(GLuint));
	}
	/*cbgl_profile_end("glColor4ui");*/
}


CBGL_API void glColor4uiv (const GLuint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4uiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4uiv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4uiv, p, sizeof(GLuint*));
	}
	/*cbgl_profile_end("glColor4uiv");*/
}


CBGL_API void glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4us");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4us(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4us, p, sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort)+sizeof(GLushort));
	}
	/*cbgl_profile_end("glColor4us");*/
}


CBGL_API void glColor4usv (const GLushort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColor4usv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColor4usv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLushort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLushort*));
		cmdBuffer_addCmd(g_cB, g_gl->glColor4usv, p, sizeof(GLushort*));
	}
	/*cbgl_profile_end("glColor4usv");*/
}


CBGL_API void glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColorMask");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColorMask(red, green, blue, alpha);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLboolean)+sizeof(GLboolean)+sizeof(GLboolean)+sizeof(GLboolean));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLboolean)+sizeof(GLboolean)+sizeof(GLboolean)+sizeof(GLboolean));
		cmdBuffer_addCmd(g_cB, g_gl->glColorMask, p, sizeof(GLboolean)+sizeof(GLboolean)+sizeof(GLboolean)+sizeof(GLboolean));
	}
	/*cbgl_profile_end("glColorMask");*/
}


CBGL_API void glColorMaterial (GLenum face, GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColorMaterial");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColorMaterial(face, mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glColorMaterial, p, sizeof(GLenum)+sizeof(GLenum));
	}
	/*cbgl_profile_end("glColorMaterial");*/
}


CBGL_API void glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glColorPointer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glColorPointer(size, type, stride, pointer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glColorPointer, p, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glColorPointer");*/
}


CBGL_API void glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCopyPixels");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCopyPixels(x, y, width, height, type);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glCopyPixels, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum));
	}
	/*cbgl_profile_end("glCopyPixels");*/
}


CBGL_API void glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCopyTexImage1D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCopyTexImage1D(target, level, internalFormat, x, y, width, border);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glCopyTexImage1D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLint));
	}
	/*cbgl_profile_end("glCopyTexImage1D");*/
}


CBGL_API void glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCopyTexImage2D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCopyTexImage2D(target, level, internalFormat, x, y, width, height, border);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glCopyTexImage2D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLint));
	}
	/*cbgl_profile_end("glCopyTexImage2D");*/
}


CBGL_API void glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCopyTexSubImage1D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCopyTexSubImage1D(target, level, xoffset, x, y, width);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei));
		cmdBuffer_addCmd(g_cB, g_gl->glCopyTexSubImage1D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei));
	}
	/*cbgl_profile_end("glCopyTexSubImage1D");*/
}


CBGL_API void glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCopyTexSubImage2D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
		cmdBuffer_addCmd(g_cB, g_gl->glCopyTexSubImage2D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
	}
	/*cbgl_profile_end("glCopyTexSubImage2D");*/
}


CBGL_API void glCullFace (GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glCullFace");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glCullFace(mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glCullFace, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glCullFace");*/
}


CBGL_API void glDeleteLists (GLuint list, GLsizei range){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDeleteLists");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDeleteLists(list, range);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint)+sizeof(GLsizei));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint)+sizeof(GLsizei));
		cmdBuffer_addCmd(g_cB, g_gl->glDeleteLists, p, sizeof(GLuint)+sizeof(GLsizei));
	}
	/*cbgl_profile_end("glDeleteLists");*/
}


CBGL_API void glDeleteTextures (GLsizei n, const GLuint *textures){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDeleteTextures");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDeleteTextures(n, textures);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLuint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLuint*));
		cmdBuffer_addCmd(g_cB, g_gl->glDeleteTextures, p, sizeof(GLsizei)+sizeof(GLuint*));
	}
	/*cbgl_profile_end("glDeleteTextures");*/
}


CBGL_API void glDepthFunc (GLenum func){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDepthFunc");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDepthFunc(func);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glDepthFunc, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glDepthFunc");*/
}


CBGL_API void glDepthMask (GLboolean flag){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDepthMask");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDepthMask(flag);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLboolean));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLboolean));
		cmdBuffer_addCmd(g_cB, g_gl->glDepthMask, p, sizeof(GLboolean));
	}
	/*cbgl_profile_end("glDepthMask");*/
}


CBGL_API void glDepthRange (GLclampd zNear, GLclampd zFar){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDepthRange");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDepthRange(zNear, zFar);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLclampd)+sizeof(GLclampd));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLclampd)+sizeof(GLclampd));
		cmdBuffer_addCmd(g_cB, g_gl->glDepthRange, p, sizeof(GLclampd)+sizeof(GLclampd));
	}
	/*cbgl_profile_end("glDepthRange");*/
}


CBGL_API void glDisable (GLenum cap){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDisable");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDisable(cap);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glDisable, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glDisable");*/
}


CBGL_API void glDisableClientState (GLenum array){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDisableClientState");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDisableClientState(array);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glDisableClientState, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glDisableClientState");*/
}


CBGL_API void glDrawArrays (GLenum mode, GLint first, GLsizei count){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDrawArrays");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDrawArrays(mode, first, count);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLsizei));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLsizei));
		cmdBuffer_addCmd(g_cB, g_gl->glDrawArrays, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLsizei));
	}
	/*cbgl_profile_end("glDrawArrays");*/
}


CBGL_API void glDrawBuffer (GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDrawBuffer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDrawBuffer(mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glDrawBuffer, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glDrawBuffer");*/
}


CBGL_API void glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDrawElements");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDrawElements(mode, count, type, indices);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glDrawElements, p, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glDrawElements");*/
}


CBGL_API void glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glDrawPixels");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glDrawPixels(width, height, format, type, pixels);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glDrawPixels, p, sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glDrawPixels");*/
}


CBGL_API void glEdgeFlag (GLboolean flag){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEdgeFlag");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEdgeFlag(flag);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLboolean));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLboolean));
		cmdBuffer_addCmd(g_cB, g_gl->glEdgeFlag, p, sizeof(GLboolean));
	}
	/*cbgl_profile_end("glEdgeFlag");*/
}


CBGL_API void glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEdgeFlagPointer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEdgeFlagPointer(stride, pointer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glEdgeFlagPointer, p, sizeof(GLsizei)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glEdgeFlagPointer");*/
}


CBGL_API void glEdgeFlagv (const GLboolean *flag){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEdgeFlagv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEdgeFlagv(flag);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLboolean*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLboolean*));
		cmdBuffer_addCmd(g_cB, g_gl->glEdgeFlagv, p, sizeof(GLboolean*));
	}
	/*cbgl_profile_end("glEdgeFlagv");*/
}


CBGL_API void glEnable (GLenum cap){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEnable");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEnable(cap);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glEnable, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glEnable");*/
}


CBGL_API void glEnableClientState (GLenum array){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEnableClientState");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEnableClientState(array);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glEnableClientState, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glEnableClientState");*/
}


CBGL_API void  glEnd (void){	
/*cbgl_profile_begin("glEnd");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEnd();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glEnd, 0, 0);
	}
	/*cbgl_profile_end("glEnd");*/
}


CBGL_API void  glEndList (void){	
/*cbgl_profile_begin("glEndList");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEndList();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glEndList, 0, 0);
	}
	/*cbgl_profile_end("glEndList");*/
}


CBGL_API void glEvalCoord1d (GLdouble u){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord1d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord1d(u);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord1d, p, sizeof(GLdouble));
	}
	/*cbgl_profile_end("glEvalCoord1d");*/
}


CBGL_API void glEvalCoord1dv (const GLdouble *u){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord1dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord1dv(u);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord1dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glEvalCoord1dv");*/
}


CBGL_API void glEvalCoord1f (GLfloat u){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord1f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord1f(u);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord1f, p, sizeof(GLfloat));
	}
	/*cbgl_profile_end("glEvalCoord1f");*/
}


CBGL_API void glEvalCoord1fv (const GLfloat *u){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord1fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord1fv(u);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord1fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glEvalCoord1fv");*/
}


CBGL_API void glEvalCoord2d (GLdouble u, GLdouble v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord2d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord2d(u, v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord2d, p, sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glEvalCoord2d");*/
}


CBGL_API void glEvalCoord2dv (const GLdouble *u){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord2dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord2dv(u);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord2dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glEvalCoord2dv");*/
}


CBGL_API void glEvalCoord2f (GLfloat u, GLfloat v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord2f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord2f(u, v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord2f, p, sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glEvalCoord2f");*/
}


CBGL_API void glEvalCoord2fv (const GLfloat *u){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalCoord2fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalCoord2fv(u);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalCoord2fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glEvalCoord2fv");*/
}


CBGL_API void glEvalMesh1 (GLenum mode, GLint i1, GLint i2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalMesh1");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalMesh1(mode, i1, i2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalMesh1, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glEvalMesh1");*/
}


CBGL_API void glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalMesh2");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalMesh2(mode, i1, i2, j1, j2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalMesh2, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glEvalMesh2");*/
}


CBGL_API void glEvalPoint1 (GLint i){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalPoint1");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalPoint1(i);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalPoint1, p, sizeof(GLint));
	}
	/*cbgl_profile_end("glEvalPoint1");*/
}


CBGL_API void glEvalPoint2 (GLint i, GLint j){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glEvalPoint2");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glEvalPoint2(i, j);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glEvalPoint2, p, sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glEvalPoint2");*/
}


CBGL_API void glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glFeedbackBuffer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFeedbackBuffer(size, type, buffer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glFeedbackBuffer, p, sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glFeedbackBuffer");*/
}


CBGL_API void  glFinish (void){	
/*cbgl_profile_begin("glFinish");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFinish();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glFinish, 0, 0);
	}
	/*cbgl_profile_end("glFinish");*/
}


CBGL_API void  glFlush (void){	
/*cbgl_profile_begin("glFlush");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFlush();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glFlush, 0, 0);
	}
	/*cbgl_profile_end("glFlush");*/
}


CBGL_API void glFogf (GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glFogf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFogf(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glFogf, p, sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glFogf");*/
}


CBGL_API void glFogfv (GLenum pname, const GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glFogfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFogfv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glFogfv, p, sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glFogfv");*/
}


CBGL_API void glFogi (GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glFogi");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFogi(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glFogi, p, sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glFogi");*/
}


CBGL_API void glFogiv (GLenum pname, const GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glFogiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFogiv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glFogiv, p, sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glFogiv");*/
}


CBGL_API void glFrontFace (GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glFrontFace");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFrontFace(mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glFrontFace, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glFrontFace");*/
}


CBGL_API void glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glFrustum");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glFrustum(left, right, bottom, top, zNear, zFar);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glFrustum, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glFrustum");*/
}


CBGL_API GLuint glGenLists (GLsizei range){
	/*cbgl_profile_begin("glGenLists");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glGenLists(range);
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glGenLists(range);
	}
}


CBGL_API void glGenTextures (GLsizei n, GLuint *textures){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGenTextures");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGenTextures(n, textures);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLuint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLuint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGenTextures, p, sizeof(GLsizei)+sizeof(GLuint*));
	}
	/*cbgl_profile_end("glGenTextures");*/
}


CBGL_API void glGetBooleanv (GLenum pname, GLboolean *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetBooleanv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetBooleanv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLboolean*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLboolean*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetBooleanv, p, sizeof(GLenum)+sizeof(GLboolean*));
	}
	/*cbgl_profile_end("glGetBooleanv");*/
}


CBGL_API void glGetClipPlane (GLenum plane, GLdouble *equation){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetClipPlane");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetClipPlane(plane, equation);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetClipPlane, p, sizeof(GLenum)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glGetClipPlane");*/
}


CBGL_API void glGetDoublev (GLenum pname, GLdouble *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetDoublev");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetDoublev(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetDoublev, p, sizeof(GLenum)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glGetDoublev");*/
}


CBGL_API GLenum glGetError (void){
	/*cbgl_profile_begin("glGetError");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glGetError();
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glGetError();
	}
}


CBGL_API void glGetFloatv (GLenum pname, GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetFloatv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetFloatv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetFloatv, p, sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetFloatv");*/
}


CBGL_API void glGetIntegerv (GLenum pname, GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetIntegerv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetIntegerv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetIntegerv, p, sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetIntegerv");*/
}


CBGL_API void glGetLightfv (GLenum light, GLenum pname, GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetLightfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetLightfv(light, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetLightfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetLightfv");*/
}


CBGL_API void glGetLightiv (GLenum light, GLenum pname, GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetLightiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetLightiv(light, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetLightiv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetLightiv");*/
}


CBGL_API void glGetMapdv (GLenum target, GLenum query, GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetMapdv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetMapdv(target, query, v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetMapdv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glGetMapdv");*/
}


CBGL_API void glGetMapfv (GLenum target, GLenum query, GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetMapfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetMapfv(target, query, v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetMapfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetMapfv");*/
}


CBGL_API void glGetMapiv (GLenum target, GLenum query, GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetMapiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetMapiv(target, query, v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetMapiv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetMapiv");*/
}


CBGL_API void glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetMaterialfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetMaterialfv(face, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetMaterialfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetMaterialfv");*/
}


CBGL_API void glGetMaterialiv (GLenum face, GLenum pname, GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetMaterialiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetMaterialiv(face, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetMaterialiv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetMaterialiv");*/
}


CBGL_API void glGetPixelMapfv (GLenum map, GLfloat *values){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetPixelMapfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetPixelMapfv(map, values);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetPixelMapfv, p, sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetPixelMapfv");*/
}


CBGL_API void glGetPixelMapuiv (GLenum map, GLuint *values){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetPixelMapuiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetPixelMapuiv(map, values);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLuint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLuint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetPixelMapuiv, p, sizeof(GLenum)+sizeof(GLuint*));
	}
	/*cbgl_profile_end("glGetPixelMapuiv");*/
}


CBGL_API void glGetPixelMapusv (GLenum map, GLushort *values){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetPixelMapusv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetPixelMapusv(map, values);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLushort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLushort*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetPixelMapusv, p, sizeof(GLenum)+sizeof(GLushort*));
	}
	/*cbgl_profile_end("glGetPixelMapusv");*/
}


CBGL_API void glGetPointerv (GLenum pname, GLvoid* *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetPointerv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetPointerv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLvoid**));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLvoid**));
		cmdBuffer_addCmd(g_cB, g_gl->glGetPointerv, p, sizeof(GLenum)+sizeof(GLvoid**));
	}
	/*cbgl_profile_end("glGetPointerv");*/
}


CBGL_API void glGetPolygonStipple (GLubyte *mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetPolygonStipple");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetPolygonStipple(mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetPolygonStipple, p, sizeof(GLubyte*));
	}
	/*cbgl_profile_end("glGetPolygonStipple");*/
}


CBGL_API const GLubyte* glGetString (GLenum name){
	/*cbgl_profile_begin("glGetString");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glGetString(name);
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glGetString(name);
	}
}


CBGL_API void glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexEnvfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexEnvfv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexEnvfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetTexEnvfv");*/
}


CBGL_API void glGetTexEnviv (GLenum target, GLenum pname, GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexEnviv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexEnviv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexEnviv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetTexEnviv");*/
}


CBGL_API void glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexGendv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexGendv(coord, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexGendv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glGetTexGendv");*/
}


CBGL_API void glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexGenfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexGenfv(coord, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexGenfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetTexGenfv");*/
}


CBGL_API void glGetTexGeniv (GLenum coord, GLenum pname, GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexGeniv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexGeniv(coord, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexGeniv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetTexGeniv");*/
}


CBGL_API void glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexImage");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexImage(target, level, format, type, pixels);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexImage, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glGetTexImage");*/
}


CBGL_API void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexLevelParameterfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexLevelParameterfv(target, level, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexLevelParameterfv, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetTexLevelParameterfv");*/
}


CBGL_API void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexLevelParameteriv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexLevelParameteriv(target, level, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexLevelParameteriv, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetTexLevelParameteriv");*/
}


CBGL_API void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexParameterfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexParameterfv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexParameterfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glGetTexParameterfv");*/
}


CBGL_API void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glGetTexParameteriv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glGetTexParameteriv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glGetTexParameteriv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glGetTexParameteriv");*/
}


CBGL_API void glHint (GLenum target, GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glHint");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glHint(target, mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glHint, p, sizeof(GLenum)+sizeof(GLenum));
	}
	/*cbgl_profile_end("glHint");*/
}


CBGL_API void glIndexMask (GLuint mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexMask");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexMask(mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexMask, p, sizeof(GLuint));
	}
	/*cbgl_profile_end("glIndexMask");*/
}


CBGL_API void glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexPointer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexPointer(type, stride, pointer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexPointer, p, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glIndexPointer");*/
}


CBGL_API void glIndexd (GLdouble c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexd");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexd(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexd, p, sizeof(GLdouble));
	}
	/*cbgl_profile_end("glIndexd");*/
}


CBGL_API void glIndexdv (const GLdouble *c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexdv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexdv(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexdv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glIndexdv");*/
}


CBGL_API void glIndexf (GLfloat c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexf(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexf, p, sizeof(GLfloat));
	}
	/*cbgl_profile_end("glIndexf");*/
}


CBGL_API void glIndexfv (const GLfloat *c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexfv(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexfv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glIndexfv");*/
}


CBGL_API void glIndexi (GLint c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexi");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexi(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexi, p, sizeof(GLint));
	}
	/*cbgl_profile_end("glIndexi");*/
}


CBGL_API void glIndexiv (const GLint *c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexiv(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexiv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glIndexiv");*/
}


CBGL_API void glIndexs (GLshort c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexs");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexs(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexs, p, sizeof(GLshort));
	}
	/*cbgl_profile_end("glIndexs");*/
}


CBGL_API void glIndexsv (const GLshort *c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexsv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexsv(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexsv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glIndexsv");*/
}


CBGL_API void glIndexub (GLubyte c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexub");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexub(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexub, p, sizeof(GLubyte));
	}
	/*cbgl_profile_end("glIndexub");*/
}


CBGL_API void glIndexubv (const GLubyte *c){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glIndexubv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glIndexubv(c);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glIndexubv, p, sizeof(GLubyte*));
	}
	/*cbgl_profile_end("glIndexubv");*/
}


CBGL_API void  glInitNames (void){	
/*cbgl_profile_begin("glInitNames");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glInitNames();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glInitNames, 0, 0);
	}
	/*cbgl_profile_end("glInitNames");*/
}


CBGL_API void glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glInterleavedArrays");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glInterleavedArrays(format, stride, pointer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glInterleavedArrays, p, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glInterleavedArrays");*/
}


CBGL_API GLboolean glIsEnabled (GLenum cap){
	/*cbgl_profile_begin("glIsEnabled");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glIsEnabled(cap);
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glIsEnabled(cap);
	}
}


CBGL_API GLboolean glIsList (GLuint list){
	/*cbgl_profile_begin("glIsList");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glIsList(list);
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glIsList(list);
	}
}


CBGL_API GLboolean glIsTexture (GLuint texture){
	/*cbgl_profile_begin("glIsTexture");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glIsTexture(texture);
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glIsTexture(texture);
	}
}


CBGL_API void glLightModelf (GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLightModelf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLightModelf(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glLightModelf, p, sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glLightModelf");*/
}


CBGL_API void glLightModelfv (GLenum pname, const GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLightModelfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLightModelfv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glLightModelfv, p, sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glLightModelfv");*/
}


CBGL_API void glLightModeli (GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLightModeli");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLightModeli(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glLightModeli, p, sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glLightModeli");*/
}


CBGL_API void glLightModeliv (GLenum pname, const GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLightModeliv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLightModeliv(pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glLightModeliv, p, sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glLightModeliv");*/
}


CBGL_API void glLightf (GLenum light, GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLightf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLightf(light, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glLightf, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glLightf");*/
}


CBGL_API void glLightfv (GLenum light, GLenum pname, const GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLightfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLightfv(light, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glLightfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glLightfv");*/
}


CBGL_API void glLighti (GLenum light, GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLighti");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLighti(light, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glLighti, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glLighti");*/
}


CBGL_API void glLightiv (GLenum light, GLenum pname, const GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLightiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLightiv(light, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glLightiv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glLightiv");*/
}


CBGL_API void glLineStipple (GLint factor, GLushort pattern){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLineStipple");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLineStipple(factor, pattern);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLushort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLushort));
		cmdBuffer_addCmd(g_cB, g_gl->glLineStipple, p, sizeof(GLint)+sizeof(GLushort));
	}
	/*cbgl_profile_end("glLineStipple");*/
}


CBGL_API void glLineWidth (GLfloat width){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLineWidth");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLineWidth(width);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glLineWidth, p, sizeof(GLfloat));
	}
	/*cbgl_profile_end("glLineWidth");*/
}


CBGL_API void glListBase (GLuint base){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glListBase");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glListBase(base);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glListBase, p, sizeof(GLuint));
	}
	/*cbgl_profile_end("glListBase");*/
}


CBGL_API void  glLoadIdentity (void){	
/*cbgl_profile_begin("glLoadIdentity");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLoadIdentity();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glLoadIdentity, 0, 0);
	}
	/*cbgl_profile_end("glLoadIdentity");*/
}


CBGL_API void glLoadMatrixd (const GLdouble *m){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLoadMatrixd");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLoadMatrixd(m);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glLoadMatrixd, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glLoadMatrixd");*/
}


CBGL_API void glLoadMatrixf (const GLfloat *m){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLoadMatrixf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLoadMatrixf(m);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glLoadMatrixf, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glLoadMatrixf");*/
}


CBGL_API void glLoadName (GLuint name){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLoadName");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLoadName(name);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glLoadName, p, sizeof(GLuint));
	}
	/*cbgl_profile_end("glLoadName");*/
}


CBGL_API void glLogicOp (GLenum opcode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glLogicOp");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glLogicOp(opcode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glLogicOp, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glLogicOp");*/
}


CBGL_API void glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMap1d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMap1d(target, u1, u2, stride, order, points);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glMap1d, p, sizeof(GLenum)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glMap1d");*/
}


CBGL_API void glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMap1f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMap1f(target, u1, u2, stride, order, points);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glMap1f, p, sizeof(GLenum)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glMap1f");*/
}


CBGL_API void glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMap2d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glMap2d, p, sizeof(GLenum)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLint)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glMap2d");*/
}


CBGL_API void glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMap2f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glMap2f, p, sizeof(GLenum)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLint)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glMap2f");*/
}


CBGL_API void glMapGrid1d (GLint un, GLdouble u1, GLdouble u2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMapGrid1d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMapGrid1d(un, u1, u2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glMapGrid1d, p, sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glMapGrid1d");*/
}


CBGL_API void glMapGrid1f (GLint un, GLfloat u1, GLfloat u2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMapGrid1f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMapGrid1f(un, u1, u2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glMapGrid1f, p, sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glMapGrid1f");*/
}


CBGL_API void glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMapGrid2d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMapGrid2d(un, u1, u2, vn, v1, v2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glMapGrid2d, p, sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLint)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glMapGrid2d");*/
}


CBGL_API void glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMapGrid2f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMapGrid2f(un, u1, u2, vn, v1, v2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glMapGrid2f, p, sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLint)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glMapGrid2f");*/
}


CBGL_API void glMaterialf (GLenum face, GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMaterialf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMaterialf(face, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glMaterialf, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glMaterialf");*/
}


CBGL_API void glMaterialfv (GLenum face, GLenum pname, const GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMaterialfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMaterialfv(face, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glMaterialfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glMaterialfv");*/
}


CBGL_API void glMateriali (GLenum face, GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMateriali");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMateriali(face, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glMateriali, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glMateriali");*/
}


CBGL_API void glMaterialiv (GLenum face, GLenum pname, const GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMaterialiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMaterialiv(face, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glMaterialiv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glMaterialiv");*/
}


CBGL_API void glMatrixMode (GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMatrixMode");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMatrixMode(mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glMatrixMode, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glMatrixMode");*/
}


CBGL_API void glMultMatrixd (const GLdouble *m){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMultMatrixd");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMultMatrixd(m);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glMultMatrixd, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glMultMatrixd");*/
}


CBGL_API void glMultMatrixf (const GLfloat *m){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glMultMatrixf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glMultMatrixf(m);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glMultMatrixf, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glMultMatrixf");*/
}


CBGL_API void glNewList (GLuint list, GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNewList");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNewList(list, mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint)+sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint)+sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glNewList, p, sizeof(GLuint)+sizeof(GLenum));
	}
	/*cbgl_profile_end("glNewList");*/
}


CBGL_API void glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3b");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3b(nx, ny, nz);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3b, p, sizeof(GLbyte)+sizeof(GLbyte)+sizeof(GLbyte));
	}
	/*cbgl_profile_end("glNormal3b");*/
}


CBGL_API void glNormal3bv (const GLbyte *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3bv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3bv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3bv, p, sizeof(GLbyte*));
	}
	/*cbgl_profile_end("glNormal3bv");*/
}


CBGL_API void glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3d(nx, ny, nz);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glNormal3d");*/
}


CBGL_API void glNormal3dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glNormal3dv");*/
}


CBGL_API void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3f(nx, ny, nz);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glNormal3f");*/
}


CBGL_API void glNormal3fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glNormal3fv");*/
}


CBGL_API void glNormal3i (GLint nx, GLint ny, GLint nz){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3i(nx, ny, nz);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glNormal3i");*/
}


CBGL_API void glNormal3iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glNormal3iv");*/
}


CBGL_API void glNormal3s (GLshort nx, GLshort ny, GLshort nz){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3s(nx, ny, nz);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glNormal3s");*/
}


CBGL_API void glNormal3sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormal3sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormal3sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glNormal3sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glNormal3sv");*/
}


CBGL_API void glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glNormalPointer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glNormalPointer(type, stride, pointer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glNormalPointer, p, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glNormalPointer");*/
}


CBGL_API void glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glOrtho");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glOrtho(left, right, bottom, top, zNear, zFar);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glOrtho, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glOrtho");*/
}


CBGL_API void glPassThrough (GLfloat token){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPassThrough");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPassThrough(token);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glPassThrough, p, sizeof(GLfloat));
	}
	/*cbgl_profile_end("glPassThrough");*/
}


CBGL_API void glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelMapfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelMapfv(map, mapsize, values);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelMapfv, p, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glPixelMapfv");*/
}


CBGL_API void glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelMapuiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelMapuiv(map, mapsize, values);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLuint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLuint*));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelMapuiv, p, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLuint*));
	}
	/*cbgl_profile_end("glPixelMapuiv");*/
}


CBGL_API void glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelMapusv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelMapusv(map, mapsize, values);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLushort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLushort*));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelMapusv, p, sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLushort*));
	}
	/*cbgl_profile_end("glPixelMapusv");*/
}


CBGL_API void glPixelStoref (GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelStoref");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelStoref(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelStoref, p, sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glPixelStoref");*/
}


CBGL_API void glPixelStorei (GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelStorei");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelStorei(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelStorei, p, sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glPixelStorei");*/
}


CBGL_API void glPixelTransferf (GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelTransferf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelTransferf(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelTransferf, p, sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glPixelTransferf");*/
}


CBGL_API void glPixelTransferi (GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelTransferi");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelTransferi(pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelTransferi, p, sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glPixelTransferi");*/
}


CBGL_API void glPixelZoom (GLfloat xfactor, GLfloat yfactor){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPixelZoom");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPixelZoom(xfactor, yfactor);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glPixelZoom, p, sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glPixelZoom");*/
}


CBGL_API void glPointSize (GLfloat size){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPointSize");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPointSize(size);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glPointSize, p, sizeof(GLfloat));
	}
	/*cbgl_profile_end("glPointSize");*/
}


CBGL_API void glPolygonMode (GLenum face, GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPolygonMode");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPolygonMode(face, mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glPolygonMode, p, sizeof(GLenum)+sizeof(GLenum));
	}
	/*cbgl_profile_end("glPolygonMode");*/
}


CBGL_API void glPolygonOffset (GLfloat factor, GLfloat units){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPolygonOffset");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPolygonOffset(factor, units);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glPolygonOffset, p, sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glPolygonOffset");*/
}


CBGL_API void glPolygonStipple (const GLubyte *mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPolygonStipple");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPolygonStipple(mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLubyte*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLubyte*));
		cmdBuffer_addCmd(g_cB, g_gl->glPolygonStipple, p, sizeof(GLubyte*));
	}
	/*cbgl_profile_end("glPolygonStipple");*/
}


CBGL_API void  glPopAttrib (void){	
/*cbgl_profile_begin("glPopAttrib");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPopAttrib();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glPopAttrib, 0, 0);
	}
	/*cbgl_profile_end("glPopAttrib");*/
}


CBGL_API void  glPopClientAttrib (void){	
/*cbgl_profile_begin("glPopClientAttrib");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPopClientAttrib();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glPopClientAttrib, 0, 0);
	}
	/*cbgl_profile_end("glPopClientAttrib");*/
}


CBGL_API void  glPopMatrix (void){	
/*cbgl_profile_begin("glPopMatrix");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPopMatrix();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glPopMatrix, 0, 0);
	}
	/*cbgl_profile_end("glPopMatrix");*/
}


CBGL_API void  glPopName (void){	
/*cbgl_profile_begin("glPopName");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPopName();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glPopName, 0, 0);
	}
	/*cbgl_profile_end("glPopName");*/
}


CBGL_API void glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPrioritizeTextures");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPrioritizeTextures(n, textures, priorities);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLuint*)+sizeof(GLclampf*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLuint*)+sizeof(GLclampf*));
		cmdBuffer_addCmd(g_cB, g_gl->glPrioritizeTextures, p, sizeof(GLsizei)+sizeof(GLuint*)+sizeof(GLclampf*));
	}
	/*cbgl_profile_end("glPrioritizeTextures");*/
}


CBGL_API void glPushAttrib (GLbitfield mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPushAttrib");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPushAttrib(mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbitfield));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbitfield));
		cmdBuffer_addCmd(g_cB, g_gl->glPushAttrib, p, sizeof(GLbitfield));
	}
	/*cbgl_profile_end("glPushAttrib");*/
}


CBGL_API void glPushClientAttrib (GLbitfield mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPushClientAttrib");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPushClientAttrib(mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLbitfield));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLbitfield));
		cmdBuffer_addCmd(g_cB, g_gl->glPushClientAttrib, p, sizeof(GLbitfield));
	}
	/*cbgl_profile_end("glPushClientAttrib");*/
}


CBGL_API void  glPushMatrix (void){	
/*cbgl_profile_begin("glPushMatrix");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPushMatrix();
	} else{
		cmdBuffer_addCmd(g_cB, g_gl->glPushMatrix, 0, 0);
	}
	/*cbgl_profile_end("glPushMatrix");*/
}


CBGL_API void glPushName (GLuint name){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glPushName");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glPushName(name);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glPushName, p, sizeof(GLuint));
	}
	/*cbgl_profile_end("glPushName");*/
}


CBGL_API void glRasterPos2d (GLdouble x, GLdouble y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2d(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2d, p, sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glRasterPos2d");*/
}


CBGL_API void glRasterPos2dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glRasterPos2dv");*/
}


CBGL_API void glRasterPos2f (GLfloat x, GLfloat y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2f(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2f, p, sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glRasterPos2f");*/
}


CBGL_API void glRasterPos2fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glRasterPos2fv");*/
}


CBGL_API void glRasterPos2i (GLint x, GLint y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2i(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2i, p, sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glRasterPos2i");*/
}


CBGL_API void glRasterPos2iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glRasterPos2iv");*/
}


CBGL_API void glRasterPos2s (GLshort x, GLshort y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2s(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2s, p, sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glRasterPos2s");*/
}


CBGL_API void glRasterPos2sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos2sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos2sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos2sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glRasterPos2sv");*/
}


CBGL_API void glRasterPos3d (GLdouble x, GLdouble y, GLdouble z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3d(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glRasterPos3d");*/
}


CBGL_API void glRasterPos3dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glRasterPos3dv");*/
}


CBGL_API void glRasterPos3f (GLfloat x, GLfloat y, GLfloat z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3f(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glRasterPos3f");*/
}


CBGL_API void glRasterPos3fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glRasterPos3fv");*/
}


CBGL_API void glRasterPos3i (GLint x, GLint y, GLint z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3i(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glRasterPos3i");*/
}


CBGL_API void glRasterPos3iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glRasterPos3iv");*/
}


CBGL_API void glRasterPos3s (GLshort x, GLshort y, GLshort z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3s(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glRasterPos3s");*/
}


CBGL_API void glRasterPos3sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos3sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos3sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos3sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glRasterPos3sv");*/
}


CBGL_API void glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4d(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glRasterPos4d");*/
}


CBGL_API void glRasterPos4dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glRasterPos4dv");*/
}


CBGL_API void glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4f(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glRasterPos4f");*/
}


CBGL_API void glRasterPos4fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glRasterPos4fv");*/
}


CBGL_API void glRasterPos4i (GLint x, GLint y, GLint z, GLint w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4i(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glRasterPos4i");*/
}


CBGL_API void glRasterPos4iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glRasterPos4iv");*/
}


CBGL_API void glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4s(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glRasterPos4s");*/
}


CBGL_API void glRasterPos4sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRasterPos4sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRasterPos4sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glRasterPos4sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glRasterPos4sv");*/
}


CBGL_API void glReadBuffer (GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glReadBuffer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glReadBuffer(mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glReadBuffer, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glReadBuffer");*/
}


CBGL_API void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glReadPixels");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glReadPixels(x, y, width, height, format, type, pixels);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glReadPixels, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glReadPixels");*/
}


CBGL_API void glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRectd");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRectd(x1, y1, x2, y2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glRectd, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glRectd");*/
}


CBGL_API void glRectdv (const GLdouble *v1, const GLdouble *v2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRectdv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRectdv(v1, v2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glRectdv, p, sizeof(GLdouble*)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glRectdv");*/
}


CBGL_API void glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRectf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRectf(x1, y1, x2, y2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glRectf, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glRectf");*/
}


CBGL_API void glRectfv (const GLfloat *v1, const GLfloat *v2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRectfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRectfv(v1, v2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glRectfv, p, sizeof(GLfloat*)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glRectfv");*/
}


CBGL_API void glRecti (GLint x1, GLint y1, GLint x2, GLint y2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRecti");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRecti(x1, y1, x2, y2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glRecti, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glRecti");*/
}


CBGL_API void glRectiv (const GLint *v1, const GLint *v2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRectiv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRectiv(v1, v2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glRectiv, p, sizeof(GLint*)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glRectiv");*/
}


CBGL_API void glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRects");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRects(x1, y1, x2, y2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glRects, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glRects");*/
}


CBGL_API void glRectsv (const GLshort *v1, const GLshort *v2){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRectsv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRectsv(v1, v2);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*)+sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*)+sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glRectsv, p, sizeof(GLshort*)+sizeof(GLshort*));
	}
	/*cbgl_profile_end("glRectsv");*/
}


CBGL_API GLint glRenderMode (GLenum mode){
	/*cbgl_profile_begin("glRenderMode");*/
	if(g_state == CBGL_IMMEDIATE){
		return g_gl->glRenderMode(mode);
	} else{
		assert("La fonction retournant une valeur, il est impossible de la placer dans le buffer");
		cmdBuffer_execute(g_cB);
		return g_gl->glRenderMode(mode);
	}
}


CBGL_API void glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRotated");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRotated(angle, x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glRotated, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glRotated");*/
}


CBGL_API void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glRotatef");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glRotatef(angle, x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glRotatef, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glRotatef");*/
}


CBGL_API void glScaled (GLdouble x, GLdouble y, GLdouble z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glScaled");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glScaled(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glScaled, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glScaled");*/
}


CBGL_API void glScalef (GLfloat x, GLfloat y, GLfloat z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glScalef");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glScalef(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glScalef, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glScalef");*/
}


CBGL_API void glScissor (GLint x, GLint y, GLsizei width, GLsizei height){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glScissor");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glScissor(x, y, width, height);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
		cmdBuffer_addCmd(g_cB, g_gl->glScissor, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
	}
	/*cbgl_profile_end("glScissor");*/
}


CBGL_API void glSelectBuffer (GLsizei size, GLuint *buffer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glSelectBuffer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glSelectBuffer(size, buffer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLsizei)+sizeof(GLuint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLsizei)+sizeof(GLuint*));
		cmdBuffer_addCmd(g_cB, g_gl->glSelectBuffer, p, sizeof(GLsizei)+sizeof(GLuint*));
	}
	/*cbgl_profile_end("glSelectBuffer");*/
}


CBGL_API void glShadeModel (GLenum mode){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glShadeModel");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glShadeModel(mode);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glShadeModel, p, sizeof(GLenum));
	}
	/*cbgl_profile_end("glShadeModel");*/
}


CBGL_API void glStencilFunc (GLenum func, GLint ref, GLuint mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glStencilFunc");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glStencilFunc(func, ref, mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glStencilFunc, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLuint));
	}
	/*cbgl_profile_end("glStencilFunc");*/
}


CBGL_API void glStencilMask (GLuint mask){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glStencilMask");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glStencilMask(mask);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLuint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLuint));
		cmdBuffer_addCmd(g_cB, g_gl->glStencilMask, p, sizeof(GLuint));
	}
	/*cbgl_profile_end("glStencilMask");*/
}


CBGL_API void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glStencilOp");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glStencilOp(fail, zfail, zpass);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLenum));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLenum));
		cmdBuffer_addCmd(g_cB, g_gl->glStencilOp, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLenum));
	}
	/*cbgl_profile_end("glStencilOp");*/
}


CBGL_API void glTexCoord1d (GLdouble s){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1d(s);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1d, p, sizeof(GLdouble));
	}
	/*cbgl_profile_end("glTexCoord1d");*/
}


CBGL_API void glTexCoord1dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glTexCoord1dv");*/
}


CBGL_API void glTexCoord1f (GLfloat s){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1f(s);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1f, p, sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTexCoord1f");*/
}


CBGL_API void glTexCoord1fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glTexCoord1fv");*/
}


CBGL_API void glTexCoord1i (GLint s){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1i(s);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1i, p, sizeof(GLint));
	}
	/*cbgl_profile_end("glTexCoord1i");*/
}


CBGL_API void glTexCoord1iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glTexCoord1iv");*/
}


CBGL_API void glTexCoord1s (GLshort s){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1s(s);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1s, p, sizeof(GLshort));
	}
	/*cbgl_profile_end("glTexCoord1s");*/
}


CBGL_API void glTexCoord1sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord1sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord1sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord1sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glTexCoord1sv");*/
}


CBGL_API void glTexCoord2d (GLdouble s, GLdouble t){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2d(s, t);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2d, p, sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glTexCoord2d");*/
}


CBGL_API void glTexCoord2dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glTexCoord2dv");*/
}


CBGL_API void glTexCoord2f (GLfloat s, GLfloat t){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2f(s, t);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2f, p, sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTexCoord2f");*/
}


CBGL_API void glTexCoord2fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glTexCoord2fv");*/
}


CBGL_API void glTexCoord2i (GLint s, GLint t){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2i(s, t);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2i, p, sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glTexCoord2i");*/
}


CBGL_API void glTexCoord2iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glTexCoord2iv");*/
}


CBGL_API void glTexCoord2s (GLshort s, GLshort t){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2s(s, t);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2s, p, sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glTexCoord2s");*/
}


CBGL_API void glTexCoord2sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord2sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord2sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord2sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glTexCoord2sv");*/
}


CBGL_API void glTexCoord3d (GLdouble s, GLdouble t, GLdouble r){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3d(s, t, r);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glTexCoord3d");*/
}


CBGL_API void glTexCoord3dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glTexCoord3dv");*/
}


CBGL_API void glTexCoord3f (GLfloat s, GLfloat t, GLfloat r){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3f(s, t, r);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTexCoord3f");*/
}


CBGL_API void glTexCoord3fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glTexCoord3fv");*/
}


CBGL_API void glTexCoord3i (GLint s, GLint t, GLint r){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3i(s, t, r);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glTexCoord3i");*/
}


CBGL_API void glTexCoord3iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glTexCoord3iv");*/
}


CBGL_API void glTexCoord3s (GLshort s, GLshort t, GLshort r){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3s(s, t, r);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glTexCoord3s");*/
}


CBGL_API void glTexCoord3sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord3sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord3sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord3sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glTexCoord3sv");*/
}


CBGL_API void glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4d(s, t, r, q);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glTexCoord4d");*/
}


CBGL_API void glTexCoord4dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glTexCoord4dv");*/
}


CBGL_API void glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4f(s, t, r, q);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTexCoord4f");*/
}


CBGL_API void glTexCoord4fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glTexCoord4fv");*/
}


CBGL_API void glTexCoord4i (GLint s, GLint t, GLint r, GLint q){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4i(s, t, r, q);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glTexCoord4i");*/
}


CBGL_API void glTexCoord4iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glTexCoord4iv");*/
}


CBGL_API void glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4s(s, t, r, q);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glTexCoord4s");*/
}


CBGL_API void glTexCoord4sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoord4sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoord4sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoord4sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glTexCoord4sv");*/
}


CBGL_API void glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexCoordPointer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexCoordPointer(size, type, stride, pointer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexCoordPointer, p, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glTexCoordPointer");*/
}


CBGL_API void glTexEnvf (GLenum target, GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexEnvf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexEnvf(target, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTexEnvf, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTexEnvf");*/
}


CBGL_API void glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexEnvfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexEnvfv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexEnvfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glTexEnvfv");*/
}


CBGL_API void glTexEnvi (GLenum target, GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexEnvi");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexEnvi(target, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glTexEnvi, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glTexEnvi");*/
}


CBGL_API void glTexEnviv (GLenum target, GLenum pname, const GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexEnviv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexEnviv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexEnviv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glTexEnviv");*/
}


CBGL_API void glTexGend (GLenum coord, GLenum pname, GLdouble param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexGend");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexGend(coord, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glTexGend, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glTexGend");*/
}


CBGL_API void glTexGendv (GLenum coord, GLenum pname, const GLdouble *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexGendv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexGendv(coord, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexGendv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glTexGendv");*/
}


CBGL_API void glTexGenf (GLenum coord, GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexGenf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexGenf(coord, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTexGenf, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTexGenf");*/
}


CBGL_API void glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexGenfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexGenfv(coord, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexGenfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glTexGenfv");*/
}


CBGL_API void glTexGeni (GLenum coord, GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexGeni");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexGeni(coord, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glTexGeni, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glTexGeni");*/
}


CBGL_API void glTexGeniv (GLenum coord, GLenum pname, const GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexGeniv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexGeniv(coord, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexGeniv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glTexGeniv");*/
}


CBGL_API void glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexImage1D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexImage1D(target, level, internalformat, width, border, format, type, pixels);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexImage1D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glTexImage1D");*/
}


CBGL_API void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexImage2D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexImage2D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLint)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glTexImage2D");*/
}


CBGL_API void glTexParameterf (GLenum target, GLenum pname, GLfloat param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexParameterf");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexParameterf(target, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTexParameterf, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTexParameterf");*/
}


CBGL_API void glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexParameterfv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexParameterfv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexParameterfv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glTexParameterfv");*/
}


CBGL_API void glTexParameteri (GLenum target, GLenum pname, GLint param){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexParameteri");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexParameteri(target, pname, param);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glTexParameteri, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint));
	}
	/*cbgl_profile_end("glTexParameteri");*/
}


CBGL_API void glTexParameteriv (GLenum target, GLenum pname, const GLint *params){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexParameteriv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexParameteriv(target, pname, params);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexParameteriv, p, sizeof(GLenum)+sizeof(GLenum)+sizeof(GLint*));
	}
	/*cbgl_profile_end("glTexParameteriv");*/
}


CBGL_API void glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexSubImage1D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexSubImage1D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glTexSubImage1D");*/
}


CBGL_API void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTexSubImage2D");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glTexSubImage2D, p, sizeof(GLenum)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei)+sizeof(GLenum)+sizeof(GLenum)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glTexSubImage2D");*/
}


CBGL_API void glTranslated (GLdouble x, GLdouble y, GLdouble z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTranslated");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTranslated(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glTranslated, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glTranslated");*/
}


CBGL_API void glTranslatef (GLfloat x, GLfloat y, GLfloat z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glTranslatef");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glTranslatef(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glTranslatef, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glTranslatef");*/
}


CBGL_API void glVertex2d (GLdouble x, GLdouble y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2d(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2d, p, sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glVertex2d");*/
}


CBGL_API void glVertex2dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glVertex2dv");*/
}


CBGL_API void glVertex2f (GLfloat x, GLfloat y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2f(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2f, p, sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glVertex2f");*/
}


CBGL_API void glVertex2fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glVertex2fv");*/
}


CBGL_API void glVertex2i (GLint x, GLint y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2i(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2i, p, sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glVertex2i");*/
}


CBGL_API void glVertex2iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glVertex2iv");*/
}


CBGL_API void glVertex2s (GLshort x, GLshort y){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2s(x, y);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2s, p, sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glVertex2s");*/
}


CBGL_API void glVertex2sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex2sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex2sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex2sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glVertex2sv");*/
}


CBGL_API void glVertex3d (GLdouble x, GLdouble y, GLdouble z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3d(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glVertex3d");*/
}


CBGL_API void glVertex3dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glVertex3dv");*/
}


CBGL_API void glVertex3f (GLfloat x, GLfloat y, GLfloat z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3f(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glVertex3f");*/
}


CBGL_API void glVertex3fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glVertex3fv");*/
}


CBGL_API void glVertex3i (GLint x, GLint y, GLint z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3i(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glVertex3i");*/
}


CBGL_API void glVertex3iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glVertex3iv");*/
}


CBGL_API void glVertex3s (GLshort x, GLshort y, GLshort z){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3s(x, y, z);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glVertex3s");*/
}


CBGL_API void glVertex3sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex3sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex3sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex3sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glVertex3sv");*/
}


CBGL_API void glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4d");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4d(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4d, p, sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble)+sizeof(GLdouble));
	}
	/*cbgl_profile_end("glVertex4d");*/
}


CBGL_API void glVertex4dv (const GLdouble *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4dv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4dv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLdouble*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLdouble*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4dv, p, sizeof(GLdouble*));
	}
	/*cbgl_profile_end("glVertex4dv");*/
}


CBGL_API void glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4f");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4f(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4f, p, sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat)+sizeof(GLfloat));
	}
	/*cbgl_profile_end("glVertex4f");*/
}


CBGL_API void glVertex4fv (const GLfloat *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4fv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4fv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLfloat*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLfloat*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4fv, p, sizeof(GLfloat*));
	}
	/*cbgl_profile_end("glVertex4fv");*/
}


CBGL_API void glVertex4i (GLint x, GLint y, GLint z, GLint w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4i");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4i(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4i, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLint)+sizeof(GLint));
	}
	/*cbgl_profile_end("glVertex4i");*/
}


CBGL_API void glVertex4iv (const GLint *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4iv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4iv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4iv, p, sizeof(GLint*));
	}
	/*cbgl_profile_end("glVertex4iv");*/
}


CBGL_API void glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4s");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4s(x, y, z, w);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4s, p, sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort)+sizeof(GLshort));
	}
	/*cbgl_profile_end("glVertex4s");*/
}


CBGL_API void glVertex4sv (const GLshort *v){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertex4sv");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertex4sv(v);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLshort*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLshort*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertex4sv, p, sizeof(GLshort*));
	}
	/*cbgl_profile_end("glVertex4sv");*/
}


CBGL_API void glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glVertexPointer");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glVertexPointer(size, type, stride, pointer);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
		cmdBuffer_addCmd(g_cB, g_gl->glVertexPointer, p, sizeof(GLint)+sizeof(GLenum)+sizeof(GLsizei)+sizeof(GLvoid*));
	}
	/*cbgl_profile_end("glVertexPointer");*/
}


CBGL_API void glViewport (GLint x, GLint y, GLsizei width, GLsizei height){
	void* saveEBP;
	void* p;
	/*cbgl_profile_begin("glViewport");*/
	if(g_state == CBGL_IMMEDIATE){
		g_gl->glViewport(x, y, width, height);
	}else{
		p = paramBuffer_addParams(g_cB->params, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
		__asm{
			mov saveEBP, ebp;
		}
		memcpy(p,(byte*)saveEBP+8, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
		cmdBuffer_addCmd(g_cB, g_gl->glViewport, p, sizeof(GLint)+sizeof(GLint)+sizeof(GLsizei)+sizeof(GLsizei));
	}
	/*cbgl_profile_end("glViewport");*/
}


